how to calculate aggregate of mdcat